<?php


/**
 * Created by PhpStorm.
 * User: cephei
 * Date: 11/25/15
 * Time: 10:03 AM
 */

namespace Plugins\DBFilm;

use Core\PluginContainer;

class Register_DBFilm{
    public function register(){
        PluginContainer::getInstance()->bind("doubanfilm",function(){;
            return new Plugin_DBFilm();
        });
    }
    public function install(\Closure $callback){
        $db = PluginContainer::getInstance()->singletonMake('database');
        $sql = file_get_contents(ROOT_PATH."/Plugins/DBFilm/dbfilm.sql");
        $db->exec($sql);
        $config = new \stdClass();
        $config->name = 'doubanfilm';
        $config->class = 'Plugins\\DBFilm\\Register_DBFilm';
        $config->enable = 1;
        $callback($config);
    }
}